import SDKManager from "../../sdk/SDKManager";
import CrazyClickC from "../../game/crazyClick/CrazyClickC";
import ModuleManager, { ModuleID } from "../../cfw/module/ModuleManager";
import LoadingController from "../../game/loading/LoadingController";
import { BattleID } from "../../sdk/SDKConfig";

// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html

const { ccclass, property } = cc._decorator;

@ccclass
export default class EggButton extends cc.Component {



    start() {
        if (SDKManager.getChannel().hasCrazyClick()) {
            this.node.active = true;
        } else {
            this.node.active = false;
        }
    }

    onButtonClick() {
        // ModuleManager.loadBundle(ModuleID.CRAZY_CLICK, () => {
        //     CrazyClickC.instance().intoLayer(1)
        // })        

        CrazyClickC.instance().gotoLayer()
        SDKManager.getChannel().battleStart(BattleID.HIT_LOBBY_EGG_TO_LOBBY)
    }

    // update (dt) {}
}
